<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<title>BoeBot Service Sample</title>
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Verdana;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:Verdana, Arial, sans-serif;}
h1
	{margin-right:0in;
	margin-left:0in;
	font-size:24.0pt;
	font-family:Verdana, Arial, sans-serif;
	font-weight:bold;}
h2
	{margin-right:0in;
	margin-left:0in;
	font-size:18.0pt;
	font-family:Verdana, Arial, sans-serif;
	font-weight:bold;}
li
    {font-family:Verdana, Arial, sans-serif;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
	{margin-right:0in;
	margin-left:0in;
	font-size:12.0pt;
	font-family:Verdana, Arial, sans-serif;}
p
	{margin-right:0in;
	margin-left:0in;
	font-size:12.0pt;
	font-family:Verdana, Arial, sans-serif;}
pre
	{margin-top:0in;
	margin-right:30.6pt;
	margin-bottom:0in;
	margin-left:30.6pt;
	margin-bottom:.0001pt;
	background:#D6D6A0;
	font-size:11.0pt;
	font-family:"Courier New";}
span.sdk
	{font-style:italic;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
.TCH { font-family: Arial Black; font-size: 12pt; background-color: #b3b3b3; }
.TX { font-family: Arial; font-size: 12pt; background-color: #e6e6e6; }
</style>

</head>

<body lang=EN-US>

<div class=Section1>

<h1>BoeBot Service Sample</h1>

<p><i><span style='font-size:11.0pt;font-family:Verdana'>This file is part of
the Microsoft Robotics Studio Code Samples. Copyright &copy; Microsoft
Corporation. All rights reserved.<br />
Updated Dec-2007 by Trevor Taylor, Software Technology, Australia</span></i></p>

<p class=MsoNormal>The BoeBot service is a Decentralized System Service (DSS)
that connects to a Parallax BoeBot over a Bluetooth serial connection.
The service consists of two parts: BASICStamp2 and BSServices.
</p>

<h2>Hardware and Software Prerequisites</h2>

<p class=MsoPlainText style='margin-left:.5in;text-indent:-.25in'><span
style='font-size:10.0pt;font-family:Symbol'>&middot;</span><span
style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
style='font-family:Verdana'>A Parallax BoeBot.</span></p>

<p class=MsoPlainText style='margin-left:.5in;text-indent:-.25in'><span
style='font-size:10.0pt;font-family:Symbol'>&middot;</span><span
style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
style='font-family:Verdana'>An EB500 Bluetooth module.</span></p>

<p class=MsoPlainText style='margin-left:.5in;text-indent:-.25in'><span
style='font-size:10.0pt;font-family:Symbol'>&middot;</span><span
style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
style='font-family:Verdana'>A Bluetooth device on your PC (either built-in or a USB-to-Bluetooth
    device).</span></p>

<p class=MsoPlainText style='margin-left:.5in;text-indent:-.25in'><span
style='font-size:10.0pt;font-family:Symbol'>&middot;</span><span
style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
style='font-family:Verdana'>Microsoft Robotics Studio Version 1.5</span></p>

<p class=MsoPlainText>Note: The BoeBot must be configured as described in the following table. This is
    not the same as in the Parallax documentation.</p>

<table>
<tr class="TCH">
    <td>Pin Number</td>
    <td>Usage</td>
</tr>
<tr class="TX">
    <td>0</td>
    <td>EB500 DO NOT USE (Serial In)</td>
</tr>
<tr class="TX">
    <td>1</td>
    <td>EB500 DO NOT USE (Serial Out)</td>
</tr>
<tr class="TX">
    <td>2</td>
    <td>Right IR Detector</td>
</tr>
<tr class="TX">
    <td>3</td>
    <td>Right IR LED</td>
</tr>
<tr class="TX">
    <td>4</td>
    <td>Pizeoelectric Speaker</td>
</tr>
<tr class="TX">
    <td>5</td>
    <td>EB500 DO NOT USE (Connected Flag)</td>
</tr>
<tr class="TX">
    <td>6</td>
    <td>EB500 DO NOT USE</td>
</tr>
<tr class="TX">
    <td>7</td>
    <td>Left Whisker</td>
</tr>
<tr class="TX">
    <td>8</td>
    <td>Right Whisker</td>
</tr>
<tr class="TX">
    <td>9</td>
    <td>Left IR LED</td>
</tr>
<tr class="TX">
    <td>10</td>
    <td>Left IR Detector</td>
</tr>
<tr class="TX">
    <td>11</td>
    <td>*** Free - Available for use ***</td>
</tr>
<tr class="TX">
    <td>12</td>
    <td>Right Servo Motor</td>
</tr>
<tr class="TX">
    <td>13</td>
    <td>Left Servo Motor</td>
</tr>
<tr class="TX">
    <td>14</td>
    <td>LED 1</td>
</tr>
<tr class="TX">
    <td>15</td>
    <td>LED 2</td>
</tr>
</table>

<p>
When you have built and configured your BoeBot, it should look like the following photo:</p>
<img src="images/BoeBot.jpg" />


<h2>To Start and Run the Sample</h2>

<p>Start the <em><span style='font-family:
Verdana'>Microsoft Robotics Studio Command Prompt</span></em> from the Programs menu.</p>

<p>To use the BoeBot with MSRS you must configure the Bluetooth
connection. The EB500 will be visible if you search for available
devices. You must &quot;pair&quot; with it by supplying a <em>passkey</em>.
The default passkey is 0000. Once you have established the pairing,
record the outgoing COM port number and then enter it into the
configuration file called Parallax.BoeBot.Config.xml in the Apps/SoftTech/Config
folder under MSRS. There is a field called SerialPort in the config file.</p>

<p>
For the BoeBot to communicate with the MSRS service, you must download
the monitor program into the BASICStamp on the BoeBot. You can use the
BASICStamp Editor supplied by Parallax for this. You must use a physical
connection, not the Bluetooth connection for downloading. The monitor
program is called BoeBotControlForMsrs.bs2 and is in the Apps/SoftTech/Parallax/Boe-Bot
directory. Note that this is a modified version of the program supplied
by Parallax and must be used if you want to use the extra features
available in the BoeBot service.
</p>

<p>Start a DssHost node and create an
instance of the service by typing the following command:</p>

<pre>
dsshost /p:50000 /m:"Apps/SoftTech/Config/Parallax.BoeBot.manifest.xml"</pre>

<p>This will start the service and you get a
response like this:</p>

<pre>
Initializing Dss Node with manifest file: .../Apps/SoftTech/Config/Parallax.BoeBot.manifest.xml </pre>

<p>
This just starts the BoeBot service, which is not much use on its own
because it requires another service to control the robot. When the
service starts up, the robot will beep twice and the LEDs will flash
if a connection is successfully established.
</p>

<p>
If you prefer, you can use a command procedure that starts
both the robot and a simple Dashboard. The Dashboard can be
used to drive the robot around. To run the command
procedure, change directory to Apps\SoftTech and run it
as follows:
</p>
<pre>
cd Apps\SoftTech<br />
RunBoeBot</pre>

<p>When the Dashboard starts up, enter <em>localhost</em> as the machine name
and click on Connect. The <em>bsdrive</em> service should appear in the
services listbox. Double-click on bsdrive to select it, then click on the
Drive button to enable driving. Now you can use the &quot;trackball&quot;
to drive the robot around.</p>

<h2>To Inspect the Service</h2>

<p>Start Internet Explorer (IE) and type the
&quot;Service uri&quot; specified in your command prompt.&nbsp; For example:</p>

<pre>
http://localhost:50000/basicstamp2</pre>

<p>This will display the BoeBot service
running on your node.&nbsp;You will be able to see the current state of the
service, including the COM port, the IR sensors, whiskers, motors, etc. If you look
in the Service Directory you should see some other services as well.</p>

<h2>Using the Service</h2>

<p>The BoeBot service implements the generic Differential Drive contract defined
by MSRS. This is what allows the Dashboard and the Drive-by-wire tutorial to
be used to drive the robot around.
</p>

<p>
If you want to take advantage of the additional operations available
for the BoeBot you must partner directly with the BoeBot service,
not the generic drive. These operations are:
</p>

<ul>
<li>Play a tone on the speaker</li>
<li>Turn I/O pins on/off, e.g. to control LEDs</li>
<li>Execute additional pre-defined behaviors (in the firmware)</li>
</ul>

<p>
<b>Note:</b> These additional functions are only available if you
download the updated version of the monitor program mentioned above.
For more information on these operations, please look in the source
code for the BASICStamp2 service.
</p>

<p>
This updated service now also includes a Compact Framework (CF) version
so that you can use a PDA or Windows CE device to drive the Boe-Bot.
The original code for this was written by Olivier Bloch from
Microsoft France. See <a 
href="http://blogs.msdn.com/obloch/archive/2007/11/03/drive-a-boebot-from-a-windows-mobile-device-using-robotics-studio.aspx">
Drive a Boe-Bot from a Windows Mobile Device using MSRS</a> for more information.
</p>

</div>

</body>

</html>
